import request from '@/utils/request'

// 查询外协订单列表
export function listOrder(query) {
  return request({
    url: '/pro/outsourcingorder/list',
    method: 'get',
    params: query
  })
}

// 查询外协订单详细
export function getOrder(id) {
  return request({
    url: '/pro/outsourcingorder/' + id,
    method: 'get'
  })
}

// 新增外协订单
export function addOrder(data) {
  return request({
    url: '/pro/outsourcingorder',
    method: 'post',
    data: data
  })
}
//执行外协订单
export function executeOrder(data) {
  return request({
    url: '/pro/outsourcingorder/executeorder',
    method: 'post',
    data: data
  })
}
// 修改外协订单
export function updateOrder(data) {
  return request({
    url: '/pro/outsourcingorder',
    method: 'put',
    data: data
  })
}

// 删除外协订单
export function delOrder(id) {
  return request({
    url: '/pro/outsourcingorder/' + id,
    method: 'delete'
  })
}

// 查询外协订单明细列表
export function listLine(query) {
  return request({
    url: '/pro/outsourcingorderline/list',
    method: 'get',
    params: query
  })
}

// 查询外协订单明细详细
export function getLine(id) {
  return request({
    url: '/pro/outsourcingorderline/' + id,
    method: 'get'
  })
}

// 新增外协订单明细
export function addLine(data) {
  return request({
    url: '/pro/outsourcingorderline',
    method: 'post',
    data: data
  })
}

// 修改外协订单明细
export function updateLine(data) {
  return request({
    url: '/pro/outsourcingorderline',
    method: 'put',
    data: data
  })
}

// 删除外协订单明细
export function delLine(id) {
  return request({
    url: '/pro/outsourcingorderline/' + id,
    method: 'delete'
  })
}
export function confirmOrder(id) {
  return request({
    url: '/pro/outsourcingorder/confirm',
    method: 'post',
    data:{orderId:id}
  })

}

// 审批列表
export function listApproveOrder(query) {
  return request({
    url: '/pro/outsourcingorder/approveList',
    method: 'get',
    params: query
  })
}
//审批流程
export function approveFlow(orderNumber) {
  return request({
    url: '/pro/outsourcingorder/approveFlow/' + orderNumber,
    method: 'get'
  })
}
//审批
export function approve(data) {
  return request({
    url: '/pro/outsourcingorder/approve',
    method: 'post',
    data: data
  })
}
// 删除图纸
export function delDrawing(id) {
  return request({
    url: '/pro/outsourcingorder/removeDrawing/' + id,
    method: 'delete'
  })
}
// 修改图纸
export function editDrawing(data) {
  return request({
    url: '/pro/outsourcingorder/editDrawing',
    method: 'put',
    data: data
  })
}
export function drawingList(query) {
  return request({
    url: '/pro/outsourcingorder/drawingList',
    method: 'get',
    params: query
  })
}
export function getDrawing(id) {
  return request({
    url: '/pro/outsourcingorder/getDrawing/' + id,
    method: 'get'
  })
}
export function getDrawingListByQcId(sourceLineId) {
  return request({
    url: '/pro/outsourcingorder/getDrawingListByQcId/'+sourceLineId,
    method: 'get',
  })
}








